import React, {Component} from 'react';
import qs from "querystring"

class Detail extends Component {
  render() {
    // 接受路由传递的params参数
    const {location: {search}} = this.props,
      {id, title, content} = qs.parse(search)
    return (
      <div>
        <ul>
          <li>ID: {id} </li>
          <li>title: {title}</li>
          <li>content: {content}</li>
        </ul>
      </div>
    );
  }
}

export default Detail;